<template>
  <view>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="大类" prop="field105">
        <el-select v-model="formData.field105" placeholder="请选择大类" clearable :style="{width: '100%'}">
          <el-option v-for="(item, index) in field105Options" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="小类" prop="field106">
        <el-select v-model="formData.field106" placeholder="请选择小类" clearable :style="{width: '100%'}">
          <el-option v-for="(item, index) in field106Options" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="问题描述" prop="field107">
        <el-input v-model="formData.field107" placeholder="请输入问题描述" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="解决建议" prop="field108">
        <el-input v-model="formData.field108" placeholder="请输入解决建议" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="业务部门" prop="field109">
        <el-select v-model="formData.field109" placeholder="请选择业务部门" clearable :style="{width: '100%'}">
          <el-option v-for="(item, index) in field109Options" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </view>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        field105: 1,
        field106: undefined,
        field107: undefined,
        field108: undefined,
        field109: undefined,
      },
      rules: {
        field105: [{
          required: true,
          message: '请选择大类',
          trigger: 'change'
        }],
        field106: [{
          required: true,
          message: '请选择小类',
          trigger: 'change'
        }],
        field107: [{
          required: true,
          message: '请输入问题描述',
          trigger: 'blur'
        }],
        field108: [{
          required: true,
          message: '请输入解决建议',
          trigger: 'blur'
        }],
        field109: [{
          required: true,
          message: '请选择业务部门',
          trigger: 'change'
        }],
      },
      field105Options: [{
        "label": "降本",
        "value": 1
      }, {
        "label": "增收",
        "value": 2
      }],
      field106Options: [{
        "label": "市场类降本",
        "value": 1
      }, {
        "label": "铁塔服务费降本",
        "value": 2
      }],
      field109Options: [{
        "label": "网络部",
        "value": 1
      }, {
        "label": "市场部",
        "value": 2
      }],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
